package com.java.dao;

import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.Types;
import java.util.ArrayList;
import java.util.HashMap;

import com.java.db.CommonConnect;
import com.java.util.DaoUtils;

public class Com0102lp02UpdateDao extends CommonDao{
	
	public ArrayList execute(HashMap requestMap,Connection con) {
		
        CallableStatement call = null;
        String Result_Val = "";
		ArrayList list = new ArrayList();

		try {
	        call = con.prepareCall("{call com_com0102p02Update( ?, ?, ?, ?)}");
	        
			
			String poi_kisu_std_no[] 	= (String[])requestMap.get("poi_kisu_std_no");
			String su_user_id[] 	= (String[])requestMap.get("su_user_id");
			String end_gubun[] 	= (String[])requestMap.get("end_gubun");
			
			
			String param[] = new String[4];
			for(int i=0; i<poi_kisu_std_no.length; i++){
	            call.setString(1, poi_kisu_std_no[i]);
	            call.setString(2, su_user_id[i]);
	            call.setString(3, end_gubun[i]);
	           
	            
	            System.out.println("넘겨온값  update =====>" + " poi_kisu_std_no===>"+poi_kisu_std_no[i]+ " su_user_id===>" + su_user_id[i]+ " end_gubun===>" + end_gubun[i]);
	            
	            call.registerOutParameter(4, Types.VARCHAR);     //Err Value
	            
	            call.execute();
	            
	            Result_Val = call.getString(4);
				
			}
			
			list.add(Result_Val);

		} catch (Exception ee) {
			ee.printStackTrace();
		}finally {
			if(call != null)
                try { call.close(); } catch(Exception e) { call = null; }
			try{
				if (con!=null) con.setAutoCommit(true);
				if (con!=null) con.close();
			}catch(Exception ee){}
		}
		return list;
	}
}
